def load_data(file_path):
    import pandas as pd
    return pd.read_csv(file_path)

def select_frames(data, num_frames=2000):
    return data.head(num_frames)

def split_data(asd_data, td_data, test_size=0.2):
    from sklearn.model_selection import train_test_split
    
    asd_labels = [1] * len(asd_data)
    td_labels = [0] * len(td_data)
    
    asd_data['Label'] = asd_labels
    td_data['Label'] = td_labels
    
    combined_data = pd.concat([asd_data, td_data])
    
    train_data, test_data = train_test_split(combined_data, test_size=test_size, stratify=combined_data['Label'], random_state=42)
    
    return train_data, test_data

def visualize_results(results):
    import matplotlib.pyplot as plt
    
    plt.figure(figsize=(10, 5))
    plt.plot(results['Epoch'], results['Accuracy'], label='Accuracy')
    plt.plot(results['Epoch'], results['Loss'], label='Loss')
    plt.title('Model Performance')
    plt.xlabel('Epoch')
    plt.ylabel('Value')
    plt.legend()
    plt.show()